<%--
  Created by IntelliJ IDEA.
  User: LW
  Date: 2022/10/20
  Time: 7:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link href="../asset/css/register.css" rel="stylesheet">
</head>
<body>

<div class="form-div">
    <div class="reg-content">
        <h1>欢迎使用本系统</h1>
        <span>未有帐号？</span> <a href="reg.jsp">注册</a>
    </div>
    <form id="reg-form" action="/01_46_luowei_war/LoginServlet" method="post">

        <table>

            <tr>
                <td>用户名</td>
                <td class="inputs">
                    <input name="username" type="text" id="username">
                    <br>
                    <span id="username_err" class="err_msg" style="display: none">用户不能为空</span>
                </td>

            </tr>

            <tr>
                <td>密码</td>
                <td class="inputs">
                    <input name="password" type="password" id="password">
                    <br>
                    <span id="password_err" class="err_msg" style="display: none">密码不能为空</span>
                </td>
            </tr>


        </table>

        <div class="buttons">
            <input value="登录" type="submit" id="reg_btn">
        </div>
        <br class="clear">
    </form>

</div>
<script>
    var usernameInput = document.getElementById("username");
    usernameInput.onblur = checkUsername;
    function checkUsername() {
        var xme=usernameInput.value.trim();
        var flag=true;
        if (xme=="") {
            document.getElementById("username_err").style.display = '';
            flag=false;
        } else {
            document.getElementById("username_err").style.display = 'none';

        }
        return flag;
    }
    var passwordInput = document.getElementById("password");
    passwordInput.onblur = checkPassword;
    function checkPassword() {
        var xme=passwordInput.value.trim();
        var flag=true;
        if (xme=="") {
            document.getElementById("password_err").style.display = '';
            flag=false;
        } else {
            document.getElementById("password_err").style.display = 'none';

        }
        return flag;
    }

</script>
</body>
</html>